//
//  UIView+UIView_Frame.h
//  OrderSeat
//
//  Created by wangwei on 13-10-14.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Additions)

@property(nonatomic, assign) CGFloat left;
@property(nonatomic, assign) CGFloat top;
@property(nonatomic, assign) CGFloat right;
@property(nonatomic, assign) CGFloat right_1;
@property(nonatomic, assign) CGFloat right_2;
@property(nonatomic, assign) CGFloat right_3;
@property(nonatomic, assign) CGFloat right_5;
@property(nonatomic, assign) CGFloat right_10;

@property(nonatomic, assign) CGFloat bottom;
@property(nonatomic, assign) CGFloat bottom_1;
@property(nonatomic, assign) CGFloat bottom_2;
@property(nonatomic, assign) CGFloat bottom_3;
@property(nonatomic, assign) CGFloat bottom_5;
@property(nonatomic, assign) CGFloat bottom_10;
@property(nonatomic, assign) CGFloat bottom_20;
@property(nonatomic, assign) CGFloat width;
@property(nonatomic, assign) CGFloat height;
@property(nonatomic, assign) CGFloat contentWidth;
@property(nonatomic, assign) CGFloat contentHeight;

@property(nonatomic, retain) NSString *frameString;
@property(nonatomic, retain) NSString *sizeString;
@property(nonatomic, retain) NSString *pointString;

- (float)topWithLevel:(int)level;

- (void)drawBorder;
- (void)drawBorderWithColor:(UIColor *)color;
- (void)drawBorderWidth:(CGFloat)borderWidth;
- (void)drawBorderWidth:(CGFloat)borderWidth andColor:(UIColor *)color;
+ (void)drawBorders:(NSArray*)views;
+ (void)drawBorders:(NSArray*)views borderWidth:(CGFloat)borderWidth;
+ (void)drawBorderWithTags:(NSArray*)tags borderWidth:(CGFloat)width withSuperView:(UIView*)superView;
+ (void)drawBorderWithTags:(NSArray*)tags withSuperView:(UIView*)superView;

+ (void)drawBorderWithTags:(NSArray*)tags borderWidth:(CGFloat)width withSuperViewTag:(int)superViewTag withBaseView:(UIView*)baseView;
+ (void)drawBorderWithTags:(NSArray*)tags withSuperViewTag:(int)superViewTag withBaseView:(UIView*)baseView;
- (void)drawCornerRadius;

- (void)autoLabelSize;
+ (void)autoLabelSizeWithViews:(NSArray*)views;

- (void)autoHeightForMutiLines;
- (void)autoWidthForSingleLine;

+ (void)autoLayoutHorizontal:(NSArray*)views;
+ (void)autoLayoutHorizontal:(NSArray*)views withMargin:(CGFloat)margin;
+ (void)autoLayoutVertical:(NSArray*)views;
+ (void)autoLayoutVertical:(NSArray*)views withMargin:(CGFloat)margin;
- (float)getLabelHeight;
- (void)autoHeight;
- (void)autoHeightNoMargin;
+ (void)autoHeightsNoMargin:(NSArray*)views;
+ (void)autoHeight:(UIView*)view andMargin:(float)margin;
+ (void)autoHeights:(NSArray *)views;
+ (void)autoHeights:(NSArray*)views andMargin:(float)margin;
- (void)autoContentHeight;
+ (CGFloat)heightForView:(UIView*)view andMargin:(float)margin;
- (void)leftMargin:(float)width;
+ (void)leftMarin:(float)width withViews:(NSArray *)views;

+ (UILabel *)createLabel:(NSString*)text font:(CGFloat)font isBold:(BOOL)isBold;
+ (UILabel *)createLabel:(NSString*)text font:(CGFloat)font isBold:(BOOL)isBold left:(CGFloat)left top:(CGFloat)top;
+ (UILabel *)createLabel:(NSString*)text font:(CGFloat)font isBold:(BOOL)isBold left:(CGFloat)left top:(CGFloat)top color:(UIColor*)color;
+ (UILabel *)createLabel:(NSString*)text font:(CGFloat)font isBold:(BOOL)isBold color:(UIColor*)color;

+ (void)hiddensYES:(NSArray *)views;
+ (void)hiddenNO:(NSArray *)views;

- (void)addTarget:(id)target action:(SEL)action;
- (void)addTarget:(id)target action:(SEL)action forTag:(int)tag;
+ (void)addTarget:(id)target action:(SEL)action forView:(UIView *)view;
+ (void)addTarget:(id)target action:(SEL)action forViews:(NSArray *)views;
+ (void)setTexts:(NSMutableDictionary *)texts forControls:(NSMutableDictionary *)controls;
+ (void)setValue:(NSString *)value forControl:(id)control;
- (void)setBackgroundNormal:(NSString*)imageName1 andSelected:(NSString*)imageName2;
- (void)setBackgroundNormal:(NSString*)imageName;
- (void)setBackgroundNormal:(NSString*)imageName isCache:(BOOL)cache;
- (void)setBackgroundNormal:(NSString*)imageName1 andSelected:(NSString*)imageName2 isCache:(BOOL)cache;

- (void)setBackgroundNormal:(NSString*)imageName1 andHighlighted:(NSString*)imageName2;
- (void)setBackgroundNormal:(NSString*)imageName1 andHighlighted:(NSString*)imageName2 isCache:(BOOL)cache;

- (void)setTitleForNormal:(NSString*)title;
- (void)setTitleForDisabled:(NSString*)title;
- (void)setTitleNormal:(NSString*)title1 andSelected:(NSString*)title2;
- (void)setTitleColorNormal:(UIColor*)color1 andSelected:(UIColor*)color2;
- (void)setTitleColorNormal:(UIColor *)color;

+(UIColor *) colorWithHexString: (NSString *) hexString;

@end
